//
//  ShowNumberView.swift
//  SelfStopWatch
//
//  Created by panda on 17/3/16.
//  Copyright © 2017年 panda. All rights reserved.
//

import UIKit

class ShowNumberView: UIView {
    
    var isStar : Bool = false {
        willSet(value){
            smallLbl.isHidden = !value
        }
    }
    
    var bigStr : String? {
        willSet(value) {
            bigLbl.text = value
        }
    }
    
    var smallStr : String? {
        willSet(value) {
            smallLbl.text = value
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.addSubview(bigLbl)
        self.addSubview(smallLbl)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    fileprivate lazy var bigLbl : UILabel = {
        let lbl = UILabel(frame: CGRect(x: 0, y: 0, width: 375, height: 60));
        lbl.font = .systemFont(ofSize: 50)
        lbl.textAlignment = .center
        lbl.text = "00:00.00"
        lbl.textColor = UIColor.white
        return lbl;
    }()
    
    fileprivate lazy var smallLbl : UILabel = {
        let lbl = UILabel(frame: CGRect(x: 0, y: self.bigLbl.frame.maxY, width: 375, height: 40));
        lbl.font = .systemFont(ofSize: 28)
        lbl.textAlignment = .center
        lbl.text = "00:00.00"
        lbl.textColor = .white
        lbl.isHidden = true;
        return lbl;
    }()
    

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
